<template>
    <!-- 业务提醒 -->
    <div class="box1">
      <div class="main-container functionalArea"> 
        <p class="title">Task Notifications</p>
        <div class="tableData">
          <table id="cTable">
            <tr class="cTr">
              <td style="width:30% background:#aca2a0;"> Pending Task(s)</td>
              <td style="width:30%">Task(s) Pending Authorization</td>
              <td>Approved</td>
              <td>Rejected</td>
            </tr >
             <tr v-for="item in authResultList" >
              <td class="cTd" style="width:30%;font-size:20px;"><a class="cOrange" @click="toAuth(item.bsnCode)">{{item.bsnName}}</a></td>
              <td class="cTd" style="width:30%">{{item.pendTask!=0?item.pendTask:0}}</td>
              <td class="cTd">{{item.approve!=0?item.approve:0}}</td>
              <td class="cTd">{{item.refuseed!=0?item.refuseed:0}}</td>
            </tr>
          </table>
        </div>
      </div>
    </div>
    <!--最近交易记录--END-->
</template>

<script>
export default {
  name: 'MyCard',
  components: {
    //ynetIcon
    // BranchDetail,
  },
  data() {
    return {
      form: {
        name: '',
        name2: '',
        input1: '',
        input2: '',
        resource: [],
        file: ''
      },
      activeName: 'first',
      cardList: [],
      tableData: [],
      NO: "1",
      authResultList: [
        {bsnCode:'IM0301',bsnName:'System Authorization',refuseed:'0',approve:'0',pendTask:'0',},
        {bsnCode:'IM0302',bsnName:'Trans Authorization',refuseed:'0',approve:'0',pendTask:'0',},
        {bsnCode:'IM0303',bsnName:'Service Authorization',refuseed:'0',approve:'0',pendTask:'0',},
      ],
      turnPageTotalNum:'',
      user:{},
    };
  },
  methods: {
    toAuth(obj){
        //console.log("index:"+index)
        let _this = this
        if(obj=='IM0301' ){
          _this.$router.push({path:'/authCenter/sysAuth'})
        }else if(obj=='IM0302'){
          _this.$router.push({path:'/authCenter/transAuth'})
        }else if(obj=='IM0303'){
          _this.$router.push({path:'/authCenter/serviceAuth'})
        }
        
    },
    handleClick(tab, event) {
      //console.log(tab, event);
    },
    remind() {
      let _this = this
      let body = {}
      //console.log("业务提醒"+_this.$tools.storage.get("user", "save"))
      //body.userNo = _this.$tools.storage.get("user", "save").userNo;
      //body.branchNo = '043469'
      _this.$tools.request(_this, "IM000202Action.do").then(
      //_this.$tools.request(_this, "IM000202Action.do", body).then(
        data => {
          //console.log("任务提醒_data:"+JSON.stringify(data))
          let authList = data.body.authList
          let authAllowList = data.body.authAllowList
          this.authResultList[0].approve=authList[0].systemApprove;
          this.authResultList[0].refuseed=authList[0].systemRefuse;

          this.authResultList[1].approve=authList[0].tranApprove;
          this.authResultList[1].refuseed=authList[0].tranRefuse;
          
          this.authResultList[2].approve=authList[0].serviceApprove;
          this.authResultList[2].refuseed=authList[0].serviceRefuse;

          //console.log("authAllowList:"+JSON.stringify(authAllowList))
          this.authResultList[0].pendTask=authAllowList[0].systemAuth;
          this.authResultList[1].pendTask=authAllowList[0].tranAuth;
          this.authResultList[2].pendTask=authAllowList[0].serviceAuth;
          //console.log("authResultList:"+JSON.stringify(this.authResultList))
          
        }
      )
    },
   
  },

  mounted() {
    let _this=this;
    this.user=_this.$tools.storage.get("user", "save")
    this.remind()
  },
}

</script>
<style>
.box1{width:70%;}
.title{
    height: 38px;
    line-height: 38px;
    border: 1px solid #f1f1f1;
    background: #fff;
    padding-left:10px;
    font-size:16px;
    margin-bottom:1px;
}
/* 行 */
#cTable{
        width: 100%;
        margin:0 auto;
        height:180px;
    }
    .cTr{
        background:#aca2a0;
         margin:10px;
         height:50px;
    }
    .cTd{
        text-align: center;
        font-family: Times New Roman;
        font-size: 40;
        margin:10px;
        padding:5px;
        line-height: 23px;
    }
</style>
